﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using TM.QWeibo.SDK.Objects;

namespace TM.QWeibo.SDK.API
{
    public class HuaTi : RequestBase
    {
        public HuaTi(OAuth oauth) : base(oauth)
        {
        }

        public void Trend(int reqnum, int pos, Action<Objects.ResponseData<Objects.HuaTi>> callback)
        {
            var parameters = new Parameters();
            parameters.Add("format", this.ResponseDataFormat.ToString().ToLower());
            parameters.Add("reqnum", reqnum);
            parameters.Add("pos", pos);
            this.GetData("http://open.t.qq.com/api/trends/ht", parameters, (json) =>
                                             {
                                                 var obj = Util.JsonToObject<ResponseData<Objects.HuaTi>>(json);
                                                 if (callback != null)
                                                 {
                                                     callback(obj);
                                                 }
                                             });
        }
    }
}
